home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / libx11inc.lha / X11 / Xm / TextInP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  5.9 KB  |  202 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC.
  3.  * ALL RIGHTS RESERVED
  4. */ 
  5. /*   $RCSfile: TextInP.h,v $ $Revision: 1.33 $ $Date: 92/05/14 12:59:07 $ */
  6. /*
  7. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  8. /*
  9. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  10. #ifndef _XmTextInP_h
  11. #define _XmTextInP_h
  12.  
  13. #include <Xm/Text.h>
  14. #include <Xm/TextStrSoP.h>
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. /****************************************************************
  21.  *
  22.  * Definitions for modules implementing text input modules.
  23.  *
  24.  ****************************************************************/
  25.  
  26. typedef struct {
  27.     int x;
  28.     int y;
  29. } SelectionHint;
  30.  
  31. typedef struct _InputDataRec {
  32.     XmTextWidget widget;        /* Back-pointer to widget record. */
  33.     XmTextScanType *sarray;    /* Description of what to cycle through on */
  34.                 /* selections. */
  35.     int sarraycount;        /* Number of elements in above. */
  36.     int new_sel_length;        /* New selection length for selection moves. */
  37.     int threshold;        /* number of pixels crossed -> drag */
  38.     SelectionHint selectionHint; /* saved coords of button down */
  39.     SelectionHint Sel2Hint;    /* saved the coords of button down */
  40.     XtIntervalId select_id;
  41.     XmTextScanType stype;    /* Current selection type. */
  42.     XmTextScanDirection extendDir;
  43.     XmTextScanDirection Sel2ExtendDir;
  44.     XmTextPosition origLeft, origRight;
  45.     XmTextPosition Sel2OrigLeft, Sel2OrigRight;
  46.     XmTextPosition stuffpos;
  47.     XmTextPosition sel2Left, sel2Right; /* secondary selection */
  48.     XmTextPosition anchor;    /* anchor point of the primary selection */
  49.     Position select_pos_x;    /* x position for timer-based scrolling */
  50.     Position select_pos_y;    /* y position for timer-based scrolling */
  51.     Boolean pendingdelete;    /* TRUE if we're implementing pending delete */
  52.     Boolean syncing;        /* If TRUE, then we've multiple keystrokes */
  53.     Boolean extending;      /* true if we are extending */
  54.     Boolean Sel2Extending;    /* true if we are extending */
  55.     Boolean hasSel2;           /* has secondary selection */
  56.     Boolean has_destination;      /* has destination selection */
  57.     Boolean selectionMove;    /* delete selection after stuff */
  58.     Boolean cancel;        /* indicates that cancel was pressed */
  59.     Boolean overstrike;         /* overstrike */
  60.     Boolean sel_start;        /* indicates that a btn2 was pressed */
  61.     Time dest_time;        /* time of destination selection ownership */
  62.     Time sec_time;        /* time of secondary selection ownership */
  63.     Time lasttime;        /* Time of last event. */
  64. } InputDataRec, *InputData;
  65.  
  66.  
  67. /* 
  68.  * Create a new instance of an input object.  By the time this is called,
  69.  * the widget context has been saved.
  70.  */
  71.  
  72. #ifdef _NO_PROTO
  73. typedef void (*InputCreateProc)(); /* widget, args, num_args */
  74. #else
  75. typedef void (*InputCreateProc)(
  76.             Widget,
  77.             ArgList,
  78.             Cardinal) ;
  79. #endif
  80.  
  81. /*
  82.  * Get values out of the input object.
  83.  */
  84. #ifdef _NO_PROTO
  85. typedef void (*InputGetValuesProc)(); /* widget, args, num_args */
  86. #else
  87. typedef void (*InputGetValuesProc)(
  88.             Widget,
  89.             ArgList,
  90.             Cardinal) ;
  91. #endif
  92.  
  93. /*
  94.  * Set values in the input object.
  95.  */
  96.  
  97. #ifdef _NO_PROTO
  98. typedef void (*InputSetValuesProc)(); /* oldw, reqw, new_w, args, num_args */
  99. #else
  100. typedef void (*InputSetValuesProc)(
  101.             Widget,
  102.             Widget,
  103.             Widget,
  104.             ArgList,
  105.             Cardinal *) ;
  106. #endif
  107.  
  108. /*
  109.  * Inform input of invalidated positions.
  110.  */
  111. #ifdef _NO_PROTO
  112. typedef void (*InputInvalidateProc)(); /* ctx, position, topos, delta */
  113. #else
  114. typedef void (*InputInvalidateProc)(
  115.             XmTextWidget,
  116.             XmTextPosition,
  117.             XmTextPosition,
  118.             long) ;
  119. #endif
  120.  
  121. /*
  122.  * Get secondary resources.
  123.  */
  124. #ifdef _NO_PROTO
  125. typedef void (*InputGetSecResProc)(); /* secResDataRtn */
  126. #else
  127. typedef void (*InputGetSecResProc)(
  128.             XmSecondaryResourceData *) ;
  129. #endif
  130.  
  131.  
  132. typedef struct _InputRec {
  133.     struct _InputDataRec *data;    /* Input-specific data; opaque type. */
  134.     InputInvalidateProc Invalidate;
  135.     InputGetValuesProc  GetValues;
  136.     InputSetValuesProc    SetValues;
  137.     XtWidgetProc    destroy;
  138.     InputGetSecResProc  GetSecResData;
  139. } InputRec;
  140.  
  141.  
  142. externalref XtPointer _XmdefaultTextActionsTable;
  143. extern Cardinal _XmdefaultTextActionsTableSize;
  144.  
  145.  
  146.  
  147. /********    Private Function Declarations    ********/
  148. #ifdef _NO_PROTO
  149.  
  150. extern Widget _XmTextGetDropReciever() ;
  151. extern Boolean _XmTextHasDestination() ;
  152. extern Boolean _XmTextSetDestinationSelection() ;
  153. extern Boolean _XmTextSetSel2() ;
  154. extern Boolean _XmTextGetSel2() ;
  155. extern void _XmTextInputGetSecResData() ;
  156. extern XmTextPosition _XmTextGetAnchor() ;
  157. extern void _XmTextInputCreate() ;
  158.  
  159. #else
  160.  
  161. extern Widget _XmTextGetDropReciever( 
  162.                         Widget w) ;
  163. extern Boolean _XmTextHasDestination( 
  164.                         Widget w) ;
  165. extern Boolean _XmTextSetDestinationSelection( 
  166.                         Widget w,
  167.                         XmTextPosition position,
  168. #if NeedWidePrototypes
  169.                         int disown,
  170. #else
  171.                         Boolean disown,
  172. #endif /* NeedWidePrototypes */
  173.                         Time set_time) ;
  174. extern Boolean _XmTextSetSel2( 
  175.                         XmTextWidget tw,
  176.                         XmTextPosition left,
  177.                         XmTextPosition right,
  178.                         Time set_time) ;
  179. extern Boolean _XmTextGetSel2( 
  180.                         XmTextWidget tw,
  181.                         XmTextPosition *left,
  182.                         XmTextPosition *right) ;
  183. extern void _XmTextInputGetSecResData( 
  184.                         XmSecondaryResourceData *secResDataRtn) ;
  185. extern XmTextPosition _XmTextGetAnchor( 
  186.                         XmTextWidget tw) ;
  187. extern void _XmTextInputCreate( 
  188.                         Widget wid,
  189.                         ArgList args,
  190.                         Cardinal num_args) ;
  191.  
  192. #endif /* _NO_PROTO */
  193. /********    End Private Function Declarations    ********/
  194.  
  195.  
  196. #ifdef __cplusplus
  197. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  198. #endif
  199.  
  200. #endif /* _XmTextInP_h */
  201. /*DON'T ADD ANYTHING AFTER THIS #endif */
  202.